package com.application.fabric.fabriccontrol.fabricinit;


/*对账本初始化进行封装
* */



import com.application.fabric.fabriccontrol.fabricinit.connect.Congateway;
import com.application.fabric.fabriccontrol.fabricinit.register.EnrollAdmin;
import com.application.fabric.fabriccontrol.fabricinit.register.RegisterUser;
import com.application.fabric.users.entity.ExtractToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Timer;


//@Configuration
//@PropertySource("classpath:application.yml")
@Repository
public class Initaccount {
    /*
    *对于这个方法我们需要封装初始化账本网关的内容
    * 对于执行的流程
    * 登记admin 注册user
    * connect gateway
    *  */
    @Autowired
    private EnrollAdmin enrollAdmin;

    @Autowired
    private RegisterUser registerUser;

    @Autowired
    private Congateway congateway;

    @Autowired
    private ExtractToken extractToken;
    public void Initmain() throws Exception{
        enrollAdmin.init();
        registerUser.init("appUser");
//        registerUser.init(extractToken.getUserid());
//        congateway.connect();
        congateway.initstatus();
    }


}
